﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PivalSoft.LDMS
{
    public partial class MDIParentfrm : Form
    {
        private int childFormNumber = 0;
        public int UserId = 0;
        public string DisplayName = string.Empty;
        public MDIParentfrm()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            Form childForm = new Form();
            childForm.MdiParent = this;
            childForm.Text = "Window " + childFormNumber++;
            childForm.Show();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }



        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void editUserToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void listContactToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void listCourtToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void addCaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAddCase caseHearing = new frmAddCase();
            caseHearing.UserId = UserId;
            caseHearing.MdiParent = this;
            caseHearing.Show();
        }

        private void listCaseToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void hearingToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void searchHearingToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void AddUserMenuItem_Click(object sender, EventArgs e)
        {
            frmAdduser adduser = new frmAdduser();
            adduser.UserId = UserId;
            adduser.MdiParent = this;
            adduser.Show();
        }

        private void ContactMenuItem_Click(object sender, EventArgs e)
        {
            frmContact contact = new frmContact();
            //contact.useri
            contact.MdiParent = this;
            contact.Show();
        }

        private void CourtMenuItem_Click(object sender, EventArgs e)
        {
            frmAddCourt court = new frmAddCourt();

            court.MdiParent = this;
            court.Show();
        }
    }
}
